package com.atguigu.daijia.driver.service.impl;

import com.atguigu.daijia.driver.config.QiniuKodoUtil;
import com.atguigu.daijia.driver.service.CosService;
import com.atguigu.daijia.model.vo.driver.CosUploadVo;
import lombok.RequiredArgsConstructor;
import lombok.extern.slf4j.Slf4j;
import org.springframework.stereotype.Service;
import org.springframework.web.multipart.MultipartFile;

@Slf4j
@Service
@RequiredArgsConstructor
@SuppressWarnings({"unchecked", "rawtypes"})
public class CosServiceImpl implements CosService {

    private final QiniuKodoUtil qiniuKodoUtil;

    /**
     * 上传文件
     * @param file
     * @param path
     * @return
     */
    @Override
    public CosUploadVo upload(MultipartFile file, String path) {
        return qiniuKodoUtil.upload(file, path);
    }
}
